<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>
<div id="content">



    <div style="text-align:center;">
        <h3>${client.fname} ${client.lname} id:${client.id} </h3>
    </div>



    <table class="table table-hover">
        <tr>
            <td><h4>Product Name</h4></td><td><h4>Status</h4></td><td><h4>Country</h4></td><td><h4>Type</h4></td><td><h4>Date</h4></td><td></td>
        </tr>
        <c:forEach var="product" items="${products}">
            <tr>
                <td><a href="${pageContext.request.contextPath}/clients/${product.clientId}/product/${product.id_product}/edit.do"> ${product.name_product}</td></a>
                <td>
                    <c:choose>
                        <c:when test="${product.status  == 0}">
                            <a  style="color:rgba(47,37,27,0.60)">Inactive</a>
                        </c:when>
                        <c:otherwise>
                            <a  style="color:rgb(81,211,96) ">Active</a>
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>

                    <c:forEach var="count" items="${countries}">
                        <c:choose>
                            <c:when test="${count.ID  == product.country}">
                                <c:out value = "${count.CName}"/>
                            </c:when>
                        </c:choose>
                    </c:forEach>

                </td>
                <td>
                    <c:forEach var="type" items="${types}">
                        <c:choose>
                            <c:when test="${type.id  == product.type_product}">
                                <c:out value = "${type.name}"/>
                            </c:when>
                        </c:choose>
                    </c:forEach>
                </td>
                <td>${product.start_date}</td>
                <td><a href="${product.id_product}/delete.do" style="color:#ff0000"> Delete</a></td>

            </tr>
        </c:forEach>
    </table>
    <br>
    <a href="${pageContext.request.contextPath}/clients/${clientId}/product/0/edit.do"><i class="icon-pencil"></i>Add new</a>
</div>
</body>
</html>